<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>


<script>
  //请求1
  //请求2
  //有一个需求本身依赖两个请求（请求1，请求2）
  //Promise.all([],[],[]...).then(results=>{})
  Promise.all([
      new Promise((resolve, reject) => {
          setTimeout(()=>{
              resolve('第一次请求结果')
          },1000)
      }),
      new Promise((resolve, reject) => {
          setTimeout(()=>{
              resolve('第二次请求结果')
          },2000)
      })
  ]).then(results =>{
      console.log(results)
      console.log(results[0]);
      console.log(results[1]);
  })

</script>
</body>
</html>